package it.polito.connectedcar.vehicle;

import java.util.concurrent.CopyOnWriteArrayList;

/**
 * The {@link VehicleNeighborhood} represents All the Zones and their vehicles
 * which has to be taken into account by a named vehicle. A vehicle has always a
 * current Zone it belongs to and a set of neighbors zones whose vehicles are
 * potentially important for the owning vehicle
 * 
 * @author Nicola Aresta
 * 
 */
public class VehicleNeighborhood {

	private CopyOnWriteArrayList<VehicleZone> neighbors;
	private VehicleZone currentZone;

	public VehicleNeighborhood() {
		neighbors = new CopyOnWriteArrayList<VehicleZone>();
	}

	public CopyOnWriteArrayList<VehicleZone> getNeighbors() {
		return neighbors;
	}

	public synchronized VehicleZone getCurrentZone() {
		return currentZone;
	}

	public synchronized void setCurrentZone(VehicleZone currentZone) {
		this.currentZone = currentZone;
	}
}
